package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Mysql struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
}
type Appconfig struct {
	Mysql
}

var AppConf Appconfig

func Init() {
	viper.SetConfigFile("../appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
	log.Println("动态读取配置成功", AppConf)
}
